﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DcsGauges.Gui.Rendering;
using DcsGauges.Gui.Gauges.Interfaces;
using DcsGauges.DataStructures;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace DcsGauges.Gui.Gauges.Concrete
{
    class EnginesPanel : GuiRenderableBase, IComposedGauge
    {
        EnginePanel leftEnginePanel                 = null;
        public EnginePanel LeftEngine
        {
            get { return this.leftEnginePanel; }
        }

        EnginePanel rightEnginePanel                = null;
        public EnginePanel RightEngine
        {
            get { return this.rightEnginePanel; }
        }

        public EnginesPanel(GuiRenderableBase parent, URect area) : base(parent, area)
        {
            this.leftEnginePanel                    = new EnginePanel(this, new URect(new ULoc(0.0f, 0.0f), new USize(0.5f, 1.0f)), leftEngine: true);
            this.rightEnginePanel                   = new EnginePanel(this, new URect(new ULoc(0.5f, 0.0f), new USize(0.5f, 1.0f)), leftEngine: false);
        }

        public override void Render(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, GraphicsDevice device, Microsoft.Xna.Framework.Rectangle parentRect, float globalZIndex)
        {
            Rectangle rect          = this.CalcViewportRect(parentRect);
            this.leftEnginePanel.Render(spriteBatch, device, rect, globalZIndex);
            this.rightEnginePanel.Render(spriteBatch, device, rect, globalZIndex);
        }
    }
}
